﻿
namespace OAuthServerApi
{
    public class CustomClaimsType
    {
        /// <summary>
        /// claim客户端Id
        /// </summary>
        public static readonly string ClientId = "as:client_id";
        /// <summary>
        /// claim用户Id
        /// </summary>
        public static readonly string UserId = "as:userid";
        /// <summary>
        /// claim用户名
        /// </summary>
        public static readonly string UserName = "as:username";
        /// <summary>
        /// claim请求GrantType
        /// </summary>
        public static readonly string GrantType = "as:grant_type";
        /// <summary>
        /// claim请求Guid
        /// </summary>
        public static readonly string RequestUniqueId = "as:unique_id";
        /// <summary>
        /// claim请求GrantType名
        /// </summary>
        public static readonly string GrantName = "as:grant_type_name";
        /// <summary>
        /// claim当前时间
        /// </summary>
        public static readonly string Now = "as:time";
        /// <summary>
        /// claim跳转url
        /// </summary>
        public static readonly string RedirectUri = "as:url";
        /// <summary>
        /// claim请求ResponseType
        /// </summary>
        public static readonly string ResponseType = "as:response_type";
        /// <summary>
        /// claim请求GrantCode
        /// </summary>
        public static readonly string GrantCode = "as:grant_code";
    }

    public class AppConstNum
    {
        /// <summary>
        /// token失效时间，默认2小时
        /// </summary>
        public static readonly int expires_in_second = 7200;
        /// <summary>
        /// refresh_token失效时间，默认30日
        /// </summary>
        public static readonly int refresh_expires_second = 2592000;
        /// <summary>
        /// 访问令牌地址
        /// </summary>
        public static readonly string AccessTokenUrl = "/oauth2/token";
        /// <summary>
        /// 用户授权地址
        /// </summary>
        public static readonly string AuthorzieUrl= "/oauth2/authorzie";
    }

    public class OwinEnvType
    {
        /// <summary>
        /// Owin环境AccessToken
        /// </summary>
        public static readonly string AccessToken = "env:access_token";
        /// <summary>
        /// Owin环境RefreshToken
        /// </summary>
        public static readonly string RefreshToken = "env:refresh_token";
        /// <summary>
        /// Owin环境GrantCode
        /// </summary>
        public static readonly string GrantCode = "env:grant_code";
        
    }

    public class OwinHeaderType
    {
        /// <summary>
        ///  Owin环境UserIdentity
        /// </summary>
        public static readonly string UserIdentityHeader = "x-oauth-user";
        /// <summary>
        ///  Owin环境UserIdentity
        /// </summary>
        public static readonly string OAuthGrant = "x-oauth-grant";
    }

    public class OwinCookieType
    {
        /// <summary>
        ///  Owin环境Cookie
        /// </summary>
        public static readonly string CookieUser = "login_user";

        public static readonly string CookieUserIdentity = "user_identity";

        public static readonly string CookieImplicitUser = "implicit_user";
    }
}